\(\int \csc (c+d x) (\cot (c+d x)+\csc (c+d x)) \, dx\) [202]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [C] (verified)
   Fricas [A] (verification not implemented)
   Sympy [A] (verification not implemented)
   Maxima [A] (verification not implemented)
   Giac [A] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 20, antiderivative size = 23 \[ \int \csc (c+d x) (\cot (c+d x)+\csc (c+d x)) \, dx=-\frac {\cot (c+d x)}{d}-\frac {\csc (c+d x)}{d} \]

[Out]

-cot(d*x+c)/d-csc(d*x+c)/d

Rubi [A] (verified)

Time = 0.11 (sec) , antiderivative size = 23, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 4, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.200, Rules used = {4482, 2748, 3852, 8} \[ \int \csc (c+d x) (\cot (c+d x)+\csc (c+d x)) \, dx=-\frac {\cot (c+d x)}{d}-\frac {\csc (c+d x)}{d} \]

[In]

Int[Csc[c + d*x]*(Cot[c + d*x] + Csc[c + d*x]),x]

[Out]

-(Cot[c + d*x]/d) - Csc[c + d*x]/d

Rule 8

Int[a_, x_Symbol] :> Simp[a*x, x] /; FreeQ[a, x]

Rule 2748

Int[(cos[(e_.) + (f_.)*(x_)]*(g_.))^(p_)*((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)]), x_Symbol] :> Simp[(-b)*((g*Co
s[e + f*x])^(p + 1)/(f*g*(p + 1))), x] + Dist[a, Int[(g*Cos[e + f*x])^p, x], x] /; FreeQ[{a, b, e, f, g, p}, x
] && (IntegerQ[2*p] || NeQ[a^2 - b^2, 0])

Rule 3852

Int[csc[(c_.) + (d_.)*(x_)]^(n_), x_Symbol] :> Dist[-d^(-1), Subst[Int[ExpandIntegrand[(1 + x^2)^(n/2 - 1), x]
, x], x, Cot[c + d*x]], x] /; FreeQ[{c, d}, x] && IGtQ[n/2, 0]

Rule 4482

Int[u_, x_Symbol] :> Int[TrigSimplify[u], x] /; TrigSimplifyQ[u]

Rubi steps \begin{align*} \text {integral}& = \int (1+\cos (c+d x)) \csc ^2(c+d x) \, dx \\ & = -\frac {\csc (c+d x)}{d}+\int \csc ^2(c+d x) \, dx \\ & = -\frac {\csc (c+d x)}{d}-\frac {\text {Subst}(\int 1 \, dx,x,\cot (c+d x))}{d} \\ & = -\frac {\cot (c+d x)}{d}-\frac {\csc (c+d x)}{d} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.12 (sec) , antiderivative size = 15, normalized size of antiderivative = 0.65 \[ \int \csc (c+d x) (\cot (c+d x)+\csc (c+d x)) \, dx=-\frac {\cot \left (\frac {1}{2} (c+d x)\right )}{d} \]

[In]

Integrate[Csc[c + d*x]*(Cot[c + d*x] + Csc[c + d*x]),x]

[Out]

-(Cot[(c + d*x)/2]/d)

Maple [C] (verified)

Result contains complex when optimal does not.

Time = 0.53 (sec) , antiderivative size = 20, normalized size of antiderivative = 0.87

method result size
risch \(-\frac {2 i}{d \left ({\mathrm e}^{i \left (d x +c \right )}-1\right )}\) \(20\)
derivativedivides \(\frac {-\cot \left (d x +c \right )-\frac {1}{\sin \left (d x +c \right )}}{d}\) \(24\)
default \(\frac {-\cot \left (d x +c \right )-\frac {1}{\sin \left (d x +c \right )}}{d}\) \(24\)
parts \(-\frac {\cot \left (d x +c \right )}{d}-\frac {\csc \left (d x +c \right )}{d}\) \(24\)

[In]

int(csc(d*x+c)*(csc(d*x+c)+cot(d*x+c)),x,method=_RETURNVERBOSE)

[Out]

-2*I/d/(exp(I*(d*x+c))-1)

Fricas [A] (verification not implemented)

none

Time = 0.24 (sec) , antiderivative size = 21, normalized size of antiderivative = 0.91 \[ \int \csc (c+d x) (\cot (c+d x)+\csc (c+d x)) \, dx=-\frac {\cos \left (d x + c\right ) + 1}{d \sin \left (d x + c\right )} \]

[In]

integrate(csc(d*x+c)*(cot(d*x+c)+csc(d*x+c)),x, algorithm="fricas")

[Out]

-(cos(d*x + c) + 1)/(d*sin(d*x + c))

Sympy [A] (verification not implemented)

Time = 0.87 (sec) , antiderivative size = 27, normalized size of antiderivative = 1.17 \[ \int \csc (c+d x) (\cot (c+d x)+\csc (c+d x)) \, dx=\begin {cases} \frac {- \cot {\left (c + d x \right )} - \csc {\left (c + d x \right )}}{d} & \text {for}\: d \neq 0 \\x \left (\cot {\left (c \right )} + \csc {\left (c \right )}\right ) \csc {\left (c \right )} & \text {otherwise} \end {cases} \]

[In]

integrate(csc(d*x+c)*(cot(d*x+c)+csc(d*x+c)),x)

[Out]

Piecewise(((-cot(c + d*x) - csc(c + d*x))/d, Ne(d, 0)), (x*(cot(c) + csc(c))*csc(c), True))

Maxima [A] (verification not implemented)

none

Time = 0.22 (sec) , antiderivative size = 22, normalized size of antiderivative = 0.96 \[ \int \csc (c+d x) (\cot (c+d x)+\csc (c+d x)) \, dx=-\frac {\frac {1}{\sin \left (d x + c\right )} + \frac {1}{\tan \left (d x + c\right )}}{d} \]

[In]

integrate(csc(d*x+c)*(cot(d*x+c)+csc(d*x+c)),x, algorithm="maxima")

[Out]

-(1/sin(d*x + c) + 1/tan(d*x + c))/d

Giac [A] (verification not implemented)

none

Time = 0.29 (sec) , antiderivative size = 16, normalized size of antiderivative = 0.70 \[ \int \csc (c+d x) (\cot (c+d x)+\csc (c+d x)) \, dx=-\frac {1}{d \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )} \]

[In]

integrate(csc(d*x+c)*(cot(d*x+c)+csc(d*x+c)),x, algorithm="giac")

[Out]

-1/(d*tan(1/2*d*x + 1/2*c))

Mupad [B] (verification not implemented)

Time = 22.54 (sec) , antiderivative size = 14, normalized size of antiderivative = 0.61 \[ \int \csc (c+d x) (\cot (c+d x)+\csc (c+d x)) \, dx=-\frac {\mathrm {cot}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{d} \]

[In]

int((cot(c + d*x) + 1/sin(c + d*x))/sin(c + d*x),x)

[Out]

-cot(c/2 + (d*x)/2)/d